# Maintainer: Robin Broda <coderobe@archlinux.org>
# Contributor: Alad Wenter <alad@mailbox.org>
# Contributor: Martin Wimpress <code@flexion.org>

pkgname=gpick
pkgver=0.3
pkgrel=1
pkgdesc="Advanced color picker written in C++ using GTK+ toolkit"
arch=('loong64' 'x86_64')
url="http://www.gpick.org/"
license=('BSD')
depends=('gtk3' 'lua')
makedepends=('boost' 'cmake' 'ragel')
options=('debug')
source=("https://github.com/thezbyg/$pkgname/releases/download/v$pkgver//$pkgname-$pkgver.tar.gz"
 	buildfix.diff)
sha256sums=('90b03ce10d2f3e211a3f37d262596e4ae40d05cbd633aa0560d0891562c93474'
            'eda057cd669b1fe90280eb1b63be31365ec166a61d6bb158721e7b1ca637beae')

prepare() {
  cd "$pkgname-$pkgver"
  # https://github.com/thezbyg/gpick/issues/211
  patch -Np1 -i ../buildfix.diff 
}

build() {
  cd "$pkgname-$pkgver"
  cmake -B build \
    -DCMAKE_INSTALL_PREFIX=/usr
  make -C build
}

check() {
  cd "$pkgname-$pkgver"
  make -C build tests
}

package() {
  cd "$pkgname-$pkgver"
  make -C build DESTDIR="${pkgdir}" install  
  install -Dm644 installer/License.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
